package com.aspose.cells;

class zbta implements zaid {
   private com.aspose.cells.b.a.b.zj a;
   private int b = 0;
   private boolean c = false;
   private double d;
   private double e;
   private double f;
   private double g;
   private int h = 7;
   private int i = 0;
   private int j = 0;
   private double k;
   private double l;
   private double m;
   private double n;
   private double o = 1.0D;
   private double p = 1.0D;
   private boolean q = false;
   private boolean r = false;

   public com.aspose.cells.b.a.b.zj a() {
      return this.a;
   }

   public void a(com.aspose.cells.b.a.b.zj var1) {
      this.a = var1;
   }

   public int b() {
      return this.b;
   }

   public void a(int var1) {
      this.b = var1;
   }

   public boolean c() {
      return this.c;
   }

   public void a(boolean var1) {
      this.c = var1;
   }

   public double d() {
      return this.d;
   }

   public void a(double var1) {
      this.d = this.a(var1, -2112.0D, 2112.0D);
   }

   public double e() {
      return this.e;
   }

   public void b(double var1) {
      this.e = this.a(var1, -2112.0D, 2112.0D);
   }

   public double f() {
      return this.f;
   }

   public void c(double var1) {
      this.f = this.a(var1, 0.0D, 100.0D);
   }

   public double g() {
      return this.g;
   }

   public void d(double var1) {
      this.g = this.a(var1, 0.0D, 100.0D);
   }

   public int h() {
      return this.h;
   }

   public void b(int var1) {
      this.h = var1;
   }

   public int i() {
      return this.i;
   }

   public void c(int var1) {
      this.i = var1;
   }

   public int j() {
      return this.j;
   }

   public void d(int var1) {
      this.j = var1;
   }

   public double k() {
      return this.k;
   }

   public void e(double var1) {
      this.k = this.a(var1, -100.0D, 100.0D);
   }

   public double l() {
      return this.l;
   }

   public void f(double var1) {
      this.l = this.a(var1, -100.0D, 100.0D);
   }

   public double m() {
      return this.m;
   }

   public void g(double var1) {
      this.m = this.a(var1, -100.0D, 100.0D);
   }

   public double n() {
      return this.n;
   }

   public void h(double var1) {
      this.n = this.a(var1, -100.0D, 100.0D);
   }

   private double a(double var1, double var3, double var5) {
      if (var1 < var3) {
         return var3;
      } else {
         return var1 > var5 ? var5 : var1;
      }
   }

   public double o() {
      return this.o;
   }

   public void i(double var1) {
      if (var1 < 0.0D) {
         this.o = 0.0D;
      }

      if (var1 > 1.0E9D) {
         this.o = 1.0E9D;
      }

      this.o = var1;
   }

   public boolean a(zbta var1) throws Exception {
      if (var1 == null) {
         return false;
      } else if (this.a != null && var1.a != null && !zbuk.a(this.a, var1.a)) {
         return false;
      } else if (this.b != var1.b()) {
         return false;
      } else if (this.c != var1.c()) {
         return false;
      } else {
         if (this.c) {
            if (this.d == var1.d() && this.f == var1.f()) {
               if (this.e == var1.e() && this.g == var1.g()) {
                  if (this.h() == var1.h() && this.i() == var1.i()) {
                     return true;
                  }

                  return false;
               }

               return false;
            }

            return false;
         } else {
            if (this.j() != var1.j()) {
               return false;
            }

            if (this.j() == 0) {
               if (this.k() != var1.k() || this.l != var1.l || this.m() != var1.m() || this.n() != var1.n()) {
                  return false;
               }
            } else if (this.j() == 2 && this.o() != var1.o()) {
               return false;
            }
         }

         return true;
      }
   }

   com.aspose.cells.b.a.b.zc a(com.aspose.cells.b.a.b.a.ze var1, float var2) {
      com.aspose.cells.b.a.b.zq var3;
      float var23;
      float var25;
      if (this.c) {
         var3 = com.aspose.cells.a.c.zn.a(var1);
         com.aspose.cells.b.a.b.zx var18 = new com.aspose.cells.b.a.b.zx(this.a, 0, var3.f(), var3.g(), var3.h(), var3.i());
         com.aspose.cells.b.a.b.a.zi var21 = new com.aspose.cells.b.a.b.a.zi();
         var23 = var3.f();
         var25 = var3.g();
         var23 = zbuk.a(var23);
         var25 = zbuk.a(var25);
         var21.b(var23, var25);
         var18.b(var21);
         return var18;
      } else {
         com.aspose.cells.b.a.b.za var17;
         float var26;
         if (this.j == 0) {
            var3 = com.aspose.cells.a.c.zn.a(var1);
            var17 = new com.aspose.cells.b.a.b.za((int)var3.h(), (int)var3.i());
            com.aspose.cells.b.a.b.zi var20 = com.aspose.cells.b.a.b.zi.a((com.aspose.cells.b.a.b.zj)var17);
            var23 = (float)((double)var17.i() * this.k() / 100.0D);
            var25 = (float)((double)var17.h() * this.m() / 100.0D);
            var26 = (float)var17.i() - (float)((double)var17.i() * this.l() / 100.0D);
            float var27 = (float)var17.h() - (float)((double)var17.h() * this.n() / 100.0D);
            com.aspose.cells.b.a.b.zq var29 = new com.aspose.cells.b.a.b.zq(var23, var25, var26 - var23, var27 - var25);
            com.aspose.cells.b.a.b.zq var30 = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, (float)this.a.i(), (float)this.a.h());
            var20.a(this.a, (com.aspose.cells.b.a.b.zq)var29, (com.aspose.cells.b.a.b.zq)var30, 2);
            com.aspose.cells.b.a.b.zx var31 = null;
            if (this.k() == 0.0D && this.m() == 0.0D && this.n == 0.0D && this.l == 0.0D) {
               var31 = new com.aspose.cells.b.a.b.zx(this.a, var3);
            } else {
               var31 = new com.aspose.cells.b.a.b.zx(var17, var3);
            }

            return var31;
         } else {
            int var7;
            int var9;
            float var11;
            float var12;
            float var13;
            com.aspose.cells.b.a.b.zq var15;
            if (this.j == 1) {
               var3 = com.aspose.cells.a.c.zn.a(var1);
               var17 = new com.aspose.cells.b.a.b.za(zbuk.a((double)var3.h()), zbuk.a((double)var3.i()));
               int var5;
               com.aspose.cells.b.a.b.zi var22;
               com.aspose.cells.b.a.b.zq var32;
               if (this.q()) {
                  var5 = (int)((float)this.a.i() * var3.i() / (float)this.a.h());
                  var22 = com.aspose.cells.b.a.b.zi.a((com.aspose.cells.b.a.b.zj)var17);
                  var7 = (int)var3.h() / var5 + 1;
                  var26 = 0.0F;

                  for(var9 = 0; var9 < var7; ++var9) {
                     var11 = 0.0F;
                     var12 = var26 + (float)var5;
                     var13 = (float)var17.h();
                     var32 = new com.aspose.cells.b.a.b.zq(var26, var11, var12 - var26, var13 - var11);
                     var15 = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, (float)(this.a.i() - 1), (float)this.a.h());
                     var22.a(this.a, (com.aspose.cells.b.a.b.zq)var32, (com.aspose.cells.b.a.b.zq)var15, 2);
                     var26 = var12;
                  }
               } else {
                  var5 = (int)((float)this.a.h() * var3.h() / (float)this.a.i());
                  var22 = com.aspose.cells.b.a.b.zi.a((com.aspose.cells.b.a.b.zj)var17);
                  var7 = (int)var3.i() / var5 + 1;
                  var26 = var3.i();

                  for(var9 = 0; var9 < var7; ++var9) {
                     float var28 = 0.0F;
                     var11 = var26 - (float)var5;
                     var12 = (float)var17.i();
                     var32 = new com.aspose.cells.b.a.b.zq(var28, var11, var12 - var28, var26 - var11);
                     var15 = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, (float)this.a.i(), (float)(this.a.h() - 1));
                     var22.a(this.a, (com.aspose.cells.b.a.b.zq)var32, (com.aspose.cells.b.a.b.zq)var15, 2);
                     var26 = var11;
                  }
               }

               com.aspose.cells.b.a.b.zx var19 = new com.aspose.cells.b.a.b.zx(var17, var3);
               return var19;
            } else {
               var3 = com.aspose.cells.a.c.zn.a(var1);
               double var4 = this.p() / this.o;
               com.aspose.cells.b.a.b.za var6 = new com.aspose.cells.b.a.b.za(zbuk.a((double)var3.h()), zbuk.a((double)var3.i()));
               com.aspose.cells.b.a.b.zi var8;
               int var10;
               float var14;
               com.aspose.cells.b.a.b.zq var16;
               if (this.q()) {
                  var7 = zbuk.a((double)var6.i() / var4);
                  var8 = com.aspose.cells.b.a.b.zi.a((com.aspose.cells.b.a.b.zj)var6);
                  var9 = (int)var3.h() / var7 + 1;

                  for(var10 = 0; var10 < var9; ++var10) {
                     var11 = (float)(var7 * var10);
                     var12 = 0.0F;
                     var13 = var11 + (float)var7;
                     var14 = var3.i();
                     var15 = new com.aspose.cells.b.a.b.zq(var11, var12, var13 - var11, var14 - var12);
                     var16 = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, (float)(this.a.i() - 1), (float)this.a.h());
                     var8.a(this.a, (com.aspose.cells.b.a.b.zq)var15, (com.aspose.cells.b.a.b.zq)var16, 2);
                  }
               } else {
                  var7 = zbuk.a((double)var6.h() / var4);
                  var8 = com.aspose.cells.b.a.b.zi.a((com.aspose.cells.b.a.b.zj)var6);
                  var9 = (int)var3.i() / var7 + 1;

                  for(var10 = 0; var10 < var9; ++var10) {
                     var11 = 0.0F;
                     var12 = var3.i() - (float)(var7 * (var10 + 1));
                     var13 = (float)var6.i();
                     var14 = var12 + (float)var7;
                     var15 = new com.aspose.cells.b.a.b.zq(var11, var12, var13 - var11, var14 - var12);
                     var16 = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, (float)this.a.i(), (float)this.a.h() - 1.0F);
                     var8.a(this.a, (com.aspose.cells.b.a.b.zq)var15, (com.aspose.cells.b.a.b.zq)var16, 2);
                  }
               }

               com.aspose.cells.b.a.b.zx var24 = new com.aspose.cells.b.a.b.zx(var6, var3);
               return var24;
            }
         }
      }
   }

   public double p() {
      return this.p;
   }

   public void j(double var1) {
      this.p = var1;
   }

   public boolean q() {
      return this.q;
   }

   public void b(boolean var1) {
      this.q = var1;
   }

   protected void finalize() throws Exception {
      this.c(false);
   }

   public void r() {
      this.c(true);
      com.aspose.cells.b.a.zg.a(this);
   }

   protected void c(boolean var1) {
      if (!this.r) {
         if (var1 && this.a != null) {
            this.a.d();
         }

         this.r = true;
      }

   }
}
